home *** CD-ROM | disk | FTP | other *** search
Wrap
RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++)))) RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++)))) NNNNaaaammmmeeee RWSet - Rogue Wave library class SSSSyyyynnnnooooppppssssiiiissss typedef RWSet Set; // Smalltalk typedef. #include <rw/rwset.h> RWSet h; DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn Class RRRRWWWWSSSSeeeetttt represents a group of unordered elements, not accessible by an external key, where duplicates are not allowed. It corresponds to the Smalltalk class SSSSeeeetttt. An object stored by RRRRWWWWSSSSeeeetttt must inherit abstract base class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee, with suitable definition for virtual functions hhhhaaaasssshhhh(((()))) and iiiissssEEEEqqqquuuuaaaallll(((()))) (see class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee). The function hhhhaaaasssshhhh(((()))) is used to find objects with the same hash value, then iiiissssEEEEqqqquuuuaaaallll(((()))) is used to confirm the match. An item cccc is considered to be "already in the collection" if there is a member of the collection with the same has value as cccc for which iiiissssEEEEqqqquuuuaaaallll((((cccc)))) returns TTTTRRRRUUUUEEEE. In this case, method iiiinnnnsssseeeerrrrtttt((((cccc)))) will not add it, thus insuring that there are no duplicates. The iterator for this class is RRRRWWWWSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee Polymorphic PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss RRRRWWWWSSSSeeeetttt (size_t n = RWDEFAULT_CAPACITY); Constructs an empty set with nnnn hashing buckets. RRRRWWWWSSSSeeeetttt (const RWSet & h); Copy constructor. Makes a shallow copy of the collection hhhh. virtual ~~~~RRRRWWWWSSSSeeeetttt(); Calls cccclllleeeeaaaarrrr(((()))). PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr OOOOppppeeeerrrraaaattttoooorrrrssss void ooooppppeeeerrrraaaattttoooorrrr====(const RWSet& h); Assignment operator. Makes a shallow copy of the collection hhhh. PPPPaaaaggggeeee 1111 RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++)))) RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++)))) RWBoolean ooooppppeeeerrrraaaattttoooorrrr========(const RWSet& h); Returns TTTTRRRRUUUUEEEE if self and hhhh have the same number of elements and if for every key in self there is a corresponding key in hhhh which iiiissssEEEEqqqquuuuaaaallll. RWBoolean ooooppppeeeerrrraaaattttoooorrrr!!!!====(const RWSet& h); Returns the negation of ooooppppeeeerrrraaaattttoooorrrr========(((()))), above. RWBoolean ooooppppeeeerrrraaaattttoooorrrr<<<<====(const RWSet& h); Returns TTTTRRRRUUUUEEEE if self is a subset of hhhh, that is, every element of self has a counterpart in hhhh which iiiissssEEEEqqqquuuuaaaallll. NNNNooootttteeee: If you inherit from RRRRWWWWSSSSeeeetttt in the presence of the C++ Standard Library, we recommend that you override this operator and explicitly forward the call. Overload resolution in C++ will choose the Standard Library provided global operators over inherited class members. These global definitions are not appropriate for set-like partial orderings. RWBoolean ooooppppeeeerrrraaaattttoooorrrr<<<<(const RWSet& h); Returns TTTTRRRRUUUUEEEE if self is a proper subset of hhhh, that is, every element of self has a counterpart in hhhh which iiiissssEEEEqqqquuuuaaaallll, but where the two sets are not identical. RWSet& ooooppppeeeerrrraaaattttoooorrrr****====(const RWSet& h); Sets self to be the intersection of self and hhhh. Returns self. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss virtual void aaaappppppppllllyyyy(RWapplyCollectable ap, void*); Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn to apply the user-supplied function pointed to by aaaapppp to each member of the collection in a (generally) unpredictable order. This supplied function must not do anything to the items that could change the ordering of the collection. virtual RWspace bbbbiiiinnnnaaaarrrryyyySSSSttttoooorrrreeeeSSSSiiiizzzzeeee() const; PPPPaaaaggggeeee 2222 RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++)))) RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++)))) Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn. virtual void cccclllleeeeaaaarrrr(); Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn. virtual void cccclllleeeeaaaarrrrAAAAnnnnddddDDDDeeeessssttttrrrrooooyyyy(); Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn. virtual int ccccoooommmmppppaaaarrrreeeeTTTToooo(const RWCollectable* a) const; Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee. virtual RWBoolean ccccoooonnnnttttaaaaiiiinnnnssss(const RWCollectable* target) const; Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn. virtual size_t eeeennnnttttrrrriiiieeeessss() const; Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn. virtual RWCollectable* ffffiiiinnnndddd(const RWCollectable* target) const; Returns the item in self which iiiissssEEEEqqqquuuuaaaallll to the item pointed to by ttttaaaarrrrggggeeeetttt or nnnniiiillll if no item is found. Hashing is used to narrow the search. virtual unsigned hhhhaaaasssshhhh() const; Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee. virtual RWCollectable* iiiinnnnsssseeeerrrrtttt(RWCollectable* c); Adds cccc to the collection and returns it. If an item is already in the collection which iiiissssEEEEqqqquuuuaaaallll to cccc, then the old item is returned and the new item is not inserted. PPPPaaaaggggeeee 3333 RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++)))) RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++)))) virtual RWClassID iiiissssAAAA() const; Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee to return ________RRRRWWWWSSSSEEEETTTT. virtual RWBoolean iiiissssEEEEmmmmppppttttyyyy() const; Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee. virtual RWBoolean iiiissssEEEEqqqquuuuaaaallll(const RWCollectable* a) const; Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn. void iiiinnnntttteeeerrrrsssseeeeccccttttWWWWiiiitttthhhh(const RWSet& h, RWSet& ret) const; Computes the intersection of self and h, and inserts the result into rrrreeeetttt (which may be either empty or not, depending on the effect desired). It may be slightly more efficient than ooooppppeeeerrrraaaattttoooorrrr****====(((()))). virtual size_t ooooccccccccuuuurrrrrrrreeeennnncccceeeessssOOOOffff(const RWCollectable* target) const; Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn. Returns the count of entries that iiiissssEEEEqqqquuuuaaaallll to the item pointed to by target. Because duplicates are not allowed for this collection, only 0 or 1 can be returned. virtual RWCollectable* rrrreeeemmmmoooovvvveeee(const RWCollectable* target); Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn. Returns and removes the item that iiiissssEEEEqqqquuuuaaaallll to the item pointed to by target, or nnnniiiillll if there is no item. virtual void rrrreeeemmmmoooovvvveeeeAAAAnnnnddddDDDDeeeessssttttrrrrooooyyyy(const RWCollectable* target); Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn. void rrrreeeessssiiiizzzzeeee(size_t n = 0); Resizes the internal hashing table to leave nnnn slots. If nnnn========0000, resizes to PPPPaaaaggggeeee 4444 RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++)))) RRRRWWWWSSSSeeeetttt((((3333CCCC++++++++)))) 3333****eeeennnnttttrrrriiiieeeessss(((())))////2222. virtual void rrrreeeessssttttoooorrrreeeeGGGGuuuuttttssss(RWvistream&); virtual void rrrreeeessssttttoooorrrreeeeGGGGuuuuttttssss(RWFile&); virtual void ssssaaaavvvveeeeGGGGuuuuttttssss(RWvostream&) const; virtual void ssssaaaavvvveeeeGGGGuuuuttttssss(RWFile&) const; Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn. RWStringID ssssttttrrrriiiinnnnggggIIIIDDDD(); (acts virtual) Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee. PPPPaaaaggggeeee 5555